package reflectionAndDynamic;

public class A {
	public void detectsName() {
		Throwable t = new Throwable();
		StackTraceElement traceLine = t.getStackTrace()[1];
		// t.printStackTrace();
		String className = traceLine.getClassName();
		String methodName = traceLine.getMethodName();
		int lineNumber = traceLine.getLineNumber();
		System.out.println(className);
		System.out.println(methodName);
		System.out.println(lineNumber);
	}
}
